Ext.application({
	name: 'Projeto',
	appFolder: '../app',
	autoCreateViewport: false,
	
	models: ['Menu'],
	stores: ['Menu', 'Images'],
	requires: ['Projeto.view.Viewport', 'Projeto.view.Login'],
	
	controllers: ['Home','Menu', 'Image', 'User', 'Login', 'Observatory'],
	
	launch: function() {
		var me = this;
		Ext.Ajax.request({
			url: 'usuarios/isLogged',
			success: function(response) {
				if (response.responseText == "") {
					Ext.widget('login').show();					
				} else {
					var data = Ext.decode(response.responseText);
					me.currentUser = data;
					Ext.widget('projetoviewport');					
				}
			}
		});
	}
});